Skip to content

BDMS-471-472-473#404

Merged
jirhiker merged 1 commit into
stagingfrom
BDMS-471-472-473
Jan 17, 2026
Merged

BDMS-471-472-473#404
jirhiker merged 1 commit into
stagingfrom
BDMS-471-472-473

Conversation

@jirhiker

Copy link
Copy Markdown
Member

Why

This PR addresses the following problem / context:

  • Use bullet points here

How

Implementation summary - the following was changed / added / removed:

  • Use bullet points here

Notes

Any special considerations, workarounds, or follow-up work to note?

  • Use bullet points here

Copilot AI review requested due to automatic review settings January 17, 2026 20:34
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@jirhiker jirhiker merged commit 6240860 into staging Jan 17, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses SQL injection vulnerabilities in the database initialization code by properly quoting role names when granting permissions.

Changes:

  • Added double-quote wrapping for role names in the GRANT statement to prevent SQL injection
  • Introduced a quoted variable to store the properly formatted role name

Comment thread db/initialization.py
return
for member in members:
safe_member = member.replace("'", "''")
quoted = f'"{safe_member}"'

Copilot AI Jan 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quoting implementation is incomplete. While double quotes are added, the variable is used inside a single-quoted SQL string, meaning the double quotes will be treated as literal characters rather than SQL delimiters. The quoted variable should be used in a formatted part of the SQL string (outside the single quotes), or the string interpolation should be restructured to properly insert the quoted identifier.

Copilot uses AI. Check for mistakes.
Comment thread db/initialization.py
BEGIN
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '{safe_member}') THEN
EXECUTE 'GRANT app_read TO {safe_member}';
EXECUTE 'GRANT app_read TO {quoted}';

Copilot AI Jan 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The {quoted} placeholder is inside a single-quoted string and will not be interpolated. It will be treated as the literal text '{quoted}' in the SQL command. This needs to be part of a formatted string (f-string) or use proper concatenation to insert the actual value of the quoted variable.

Copilot uses AI. Check for mistakes.
@TylerAdamMartinez TylerAdamMartinez deleted the BDMS-471-472-473 branch February 26, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants